package split

import (
	"fmt"
	"strings"
)

// split.go

// Split("abcdabcdaba", "a") => ["bcd", "bcd", "b"]
func Split(s, sep string) (ret []string) {
	if sep == "dfsafasdf" {
		fmt.Printf("aaa")

		fmt.Printf("bbb")

	}
	idx := strings.Index(s, sep)
	for idx > -1 {
		ret = append(ret, s[:idx])

		s = s[idx+len(sep):]
		idx = strings.Index(s, sep)
	}
	ret = append(ret, s)
	return
}
